import { useDomainStoreWithOut } from '/@/store/modules/domain';
import { computed } from 'vue';

export function useDomain() {
  const domainStore = useDomainStoreWithOut();
  const getTenantId = computed(() => domainStore.getTenantId);
  const getDomain = computed(() => domainStore.getDomain);
  const getRememberMe = computed(() => domainStore.getrRememberMe);
  const getUseConfig = computed(() => domainStore.getUseConfig);
  const getUseProjectSetting = computed(() => domainStore.getProjectInfo);

  function changeDomain(domain) {
    domainStore.setDomainInfo(domain);
  }
  function changeTenantId(id) {
    domainStore.setTenantId(id);
  }

  function updateRememberMe(remember) {
    domainStore.setRememberMe(remember);
  }
  function updateUserConfig(user) {
    domainStore.setUser(user);
  }
  function setProjectInfo(info) {
    domainStore.setProjectInfo(info);
  }
  function changeProjectInfo(projectSetting) {
    domainStore.setProjectInfo(projectSetting);
  }
  return {
    getTenantId,
    getDomain,
    getRememberMe,
    getUseConfig,
    getUseProjectSetting,
    changeDomain,
    changeTenantId,
    updateRememberMe,
    updateUserConfig,
    setProjectInfo,
    changeProjectInfo,
  };
}
